
const { ccclass, property } = cc._decorator;
/** 复杂聊天表情 create by tm */
@ccclass
export default class DWC_DCEmoticonItem extends cc.Component {

    //-----------组件区----------
    @property(cc.Sprite)
    img_emoticon: cc.Sprite = null;
    //-----------变量区----------
    /** 表情在表情列表中的idx */
    emoticonIdx: number = null;
    /** 表情 父级node */
    emoticonParent: cc.Node = null;
    onLoad() {

    }
    /** 初始化(外界调用) */
    init(_args): void {
        if (_args.sf) {
            this.img_emoticon.spriteFrame = _args.sf;
        }
        this.emoticonIdx = _args.idx;
        this.emoticonParent = _args.emoticonNode;
    }
    /** 点击表情 */
    touchEmoticon(): void {
        this.emoticonParent && this.emoticonParent.emit(`dwc_detailChat_touchEmoticonItem`, {
            idx: this.emoticonIdx,
            emoticonName: this.img_emoticon.spriteFrame.name
        });
    }
    onDestroy() {

    }
}
